package com.cty.B_SpecialDataStructures.C_PriorityQ.PriorityQChain;

import com.cty.F_common.DataItem;

/**
 * @Auther: cty
 * @Date: 2020/6/14 23:26
 * @Description: 有序列表实现优先级队列
 * 应用场景：
 *      数据量不可预测时使用
 * 重要操作：
 *      ① insert(DataItem): void    O(N)
 *      ② remove(): DataItem    O(1)
 * @version: 1.0
 */
public class PriorityQChain {
    private OrdLinkedList list;

    public PriorityQChain(){
        list = new OrdLinkedList();
    }

    public boolean isEmpty(){
        return list.isEmpty();
    }

    public void displayPriorityQ(){
        list.displayList();
    }

    public void insert(DataItem item){
        list.insert(item);
    }

    public DataItem remove(){
        return list.deleteFirst();
    }

}  // end PriorityQChain{}
